package com.dmjj.cad.service.impl;

import com.dmjj.cad.dao.FloorplanMapper;
import com.dmjj.cad.dto.FloorplanDTO;
import com.dmjj.cad.dto.GraphDTO;
import com.dmjj.cad.service.FloorplanService;
import com.dmjj.cadcommon.base.BaseMapper;
import com.dmjj.cadcommon.base.BaseServiceImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;


/**
 * 平面图管理表业务处理接口
 * @Author zhangxue
 * @Date 2019-04-19 10:39:23
 */
@Service
public class FloorplanServiceImpl extends BaseServiceImpl<FloorplanDTO, Long> implements FloorplanService {

    private static final Log LOGGER = LogFactory.getLog(FloorplanServiceImpl.class);

    @Autowired
    private FloorplanMapper mapper;

    @Override
    protected BaseMapper<FloorplanDTO, Long> getMapper() {
        return mapper;
    }

    /**
     * 平面图管理表列表
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public List<FloorplanDTO> list4Page(FloorplanDTO entity, Integer pageNum, Integer... pageSize) {
        return super.list4Page(entity, pageNum, pageSize);
    }

    /**
     * 平面图管理表列表（无分页）
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public List<FloorplanDTO> listByCondition(FloorplanDTO entity) {
        return super.listByCondition(entity);
    }

    /**
     * 查询平面图管理表详情信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public FloorplanDTO queryOneByPk(Long id) {
        return super.queryOneByPk(id);
    }

    /**
     * 保存平面图管理表信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Long save(FloorplanDTO entity) {
        return super.save(entity);
    }

    /**
     * 删除平面图管理表信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Integer delete(Long id) {
        return super.delete(id);
    }

    @Override
    public int deleteGraphByFloorplanId(Long id) {
        return mapper.deleteGraphByFloorplanId(id);
    }

    @Override
    public List<GraphDTO> selectGraphIdByFloorPlanId(Long id) {
        return mapper.selectGraphIdByFloorPlanId(id);
    }

    @Override
    public Integer deleteGraphSonByGraphIds(Map<String,String> map) {
        return mapper.deleteGraphSonByGraphIds( map);
    }
}
